﻿using System;
using Autodesk.Revit.DB;
using YJKInspectModelFunc.ModelLayer;

namespace YJKSparseDistance.ModelLayer
{
	public class BulidingCurvePakcer : BaseCurvePacker
	{
		public BulidingCurvePakcer(Curve inputCurve, BaseElementPacker useElementPacker, bool ifCanGo, bool ifFreeEnd = false, bool ifCanIntersection = false, bool ifDoorFreeEnd = false) : base(inputCurve, ifCanGo, ifFreeEnd, ifCanIntersection, ifDoorFreeEnd)
		{
			if (useElementPacker != null)
			{
				if (useElementPacker.ThisElement != null)
				{
					this.m_nUseElementId = useElementPacker.ThisElement.Id.IntegerValue;
				}
				if (useElementPacker.UseRevitLinkInstance != null)
				{
					this.m_nUseLinkedInstanceId = useElementPacker.UseRevitLinkInstance.Id.IntegerValue;
				}
			}
		}

		public BulidingCurvePakcer(Curve inputCurve, int elementPackerId, int linkInstacneId, bool ifCanGo, bool ifFreeEnd = false, bool ifCanIntersection = false, bool ifDoorFreeEnd = false) : base(inputCurve, ifCanGo, ifFreeEnd, ifCanIntersection, ifDoorFreeEnd)
		{
			this.m_nUseElementId = elementPackerId;
			this.m_nUseLinkedInstanceId = linkInstacneId;
		}

		public int UseElementId
		{
			get
			{
				return this.m_nUseElementId;
			}
		}

		public int UseLinkedInstanceId
		{
			get
			{
				return this.m_nUseLinkedInstanceId;
			}
		}

		private int m_nUseElementId = -1;

		private int m_nUseLinkedInstanceId = -1;
	}
}
